package com.woniuxy.config;

import com.woniuxy.core.service.RunExpirationService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@RequiredArgsConstructor
public class RunExpirationScheduler {
    @Autowired
    private RunExpirationService runExpirationService;

    // 每5分钟执行一次（根据业务需求调整）
    @Scheduled(cron = "0 */300 * * * ?")
    public void checkExpiredRuns() {
        runExpirationService.handleExpiredRuns();
    }
}
